package com.fingard.dsp.bank.directbank.webank11;

import java.io.File;
import java.util.Calendar;
import java.util.Date;

import com.fingard.constant.Format;
import com.fingard.dsp.bank.directbank.DirectBase;

public class Webank11Base extends DirectBase {
	protected String getCharset() {
		return getBankConfig().getCharset("UTF-8");
	}

	protected String getYestodayStr() {
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(new Date());
		calendar.add(Calendar.DATE, -1);// 把日期往前减一天.整数往后推,负数往前移动
		return Format.Date8Format.format(calendar.getTime());
	}
	
	protected int getBatSeqNo(String p_reqDir) {
		int batSeqNo = -1;
		File refundFileDir = new File(p_reqDir);
		if (refundFileDir.exists()) {
			File[] refundFileList = refundFileDir.listFiles();
			if (refundFileList != null) {
				int total = 0;
				for(File refundFile : refundFileList) {
					if (!refundFile.getName().endsWith("zip")) {
						total++;
					}
				}
				batSeqNo = total + 1;
			}
		} else {
			batSeqNo = 1;
		}
		
		return batSeqNo;
	}
}
